import java.util.Scanner;

public class zy20 {

	public static void main(String[] args) {
		int a[] = new int[20], i;
		Scanner r = new Scanner(System.in);
		for (i = 0; i <= 19; i++)
			a[i] = r.nextInt();
		System.out.printf("%.2f", fun(a, 20));
		r.close();
	}

	public static double fun(int a[], int n) {
		int i, max = a[0], min = a[0], s = 0;
		for (i = 0; i <= n - 1; i++) {
			if (a[i] > max)
				max = a[i];
			else if(a[i]<min)
				min=a[i];
			s = s + a[i];
		}
		return (s - max - min) * 1.0 / (n - 2);
	}
}
